from flask import Flask
from flask_uploads import configure_uploads
from flask_uploads import UploadSet, IMAGES,DOCUMENTS,EXECUTABLES,ARCHIVES

photos = UploadSet('photos', IMAGES)
reports = UploadSet('reports', ('docx','pdf','grf')) #文档类型后缀名
tools=UploadSet('tools',DOCUMENTS+EXECUTABLES+ARCHIVES+IMAGES) #多元祖支持
supplierRawYp=UploadSet('supplierRawYp',DOCUMENTS+EXECUTABLES+ARCHIVES+IMAGES) #多元祖支持
storeRawYp=UploadSet('storeRawYp',DOCUMENTS+EXECUTABLES+ARCHIVES+IMAGES) #多元祖支持
customerRawYp=UploadSet('customerRawYp',DOCUMENTS+EXECUTABLES+ARCHIVES+IMAGES) #多元祖支持
customerFinishedYp=UploadSet('customerFinishedYp',DOCUMENTS+EXECUTABLES+ARCHIVES+IMAGES) #多元祖支持
def init_upload(app: Flask):
    configure_uploads(app, photos)
    configure_uploads(app, reports)
    configure_uploads(app, tools)
    configure_uploads(app, supplierRawYp)
    configure_uploads(app, customerRawYp)
    configure_uploads(app, customerFinishedYp)
    configure_uploads(app, storeRawYp)
